﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _2023._5._10实验
{
    public partial class Form1 : Form
    {
        public static Form1 _form1;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("我也爱你");
        }

        private void button2Unlove_Click(object sender, EventArgs e)
        {

        }

        private void button2Unlove_MouseEnter(object sender, EventArgs e)
        {
            int x = this.ClientSize.Width - button1Love.Size.Width;
            int y = this.ClientSize.Height - button1Love.Size.Width;
            Random random = new Random();
            button2Unlove.Location = new Point(random.Next(0, x + 1), random.Next(0, y + 1));
        }

        private void buttonNewWindow_Click(object sender, EventArgs e)
        {
            Form2 form = new Form2();
            form.Show();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            _form1 = this;
        }
    }
}
